#!/bin/bash

for i in `ls`
do
    if [ -f ${i}/Makefile ]
    then
        echo -e "\x1b[1;32mCompiling ${i}...\x1b[0m"

        make -C ${i} $1 $2

        if [ $? -ne 0 ]
        then
            echo -e "\x1b[1;31mfailed\x1b[0m (press a key to continue)"
            read
        else
            echo -e "\x1b[1;32mok\x1b[0m"
        fi
    fi
done

